<h3 class="page-heading">TDengine Connection</h3>

<div class="gf-form-group">
	<div class="gf-form max-width-30">
		<span class="gf-form-label width-7">Host</span>
		<input type="text" class="gf-form-input" name="url"
		  ng-model='ctrl.current.url' placeholder="http://localhost:6041" ng-change="ctrl.onHostChange()"
			required></input>
	</div>

	<div class="gf-form-inline">
		<div class="gf-form max-width-15">
			<span class="gf-form-label width-7">User</span>
			<input type="text" class="gf-form-input" name="user"
			  ng-model='ctrl.current.secureJsonData.user'
			  placeholder="{{ctrl.current.secureJsonFields.basicAuth ? 'configured' : ''}}"></input>
		</div>
		<div class="gf-form max-width-15">
			<span class="gf-form-label width-7">Password</span>
			<input type="password" class="gf-form-input" name="password" ng-model='ctrl.current.secureJsonData.password' ng-change="ctrl.onAuthChange()"
				placeholder="{{ctrl.current.secureJsonFields.basicAuth ? 'configured' : ''}}"></input>
		</div>
	</div>
	<div class="gf-form max-width-30">
		<span class="gf-form-label width-7">Cloud Token</span>
		<input type="text" class="gf-form-input" name="token" ng-model='ctrl.current.secureJsonData.token'
		  placeholder="{{ctrl.current.secureJsonFields.token ? 'configured' : ''}}"></input>
	</div>
</div>
<div class="gf-form max-width-30">
	<h3 style="padding-top:4px;padding-right:15px;">Alibaba Cloud Sms Config</h3>
	<div class="gf-form-switch " style="margin-left:4px;">
		<input type="checkbox" name="smsShowFlag" ng-model="ctrl.smsShowFlag">
		<span class="gf-form-switch__slider" ng-click="ctrl.smsShowChange()"></span>
	</div>
	<div class="gf-form-label">{{ctrl.smsShowFlag?"show":"hide"}}</div>
</div>
<div class="gf-form-group" ng-show="ctrl.smsShowFlag">
	<div class="gf-form max-width-30">
		<span class="gf-form-label width-7">accessKeyId</span>
		<input type="text" class="gf-form-input" name="accessKeyId"
		  ng-model='ctrl.current.secureJsonData.aliSmsAccessKeyId'
			placeholder="{{ctrl.current.secureJsonFields.aliSmsAccessKeyId ? 'configured' : ''}}"
			></input>
	</div>
	<div class="gf-form max-width-30">
		<span class="gf-form-label width-7">accessKeySecret</span>
		<input type="text" class="gf-form-input" name="accessKeySecret"
			ng-model='ctrl.current.secureJsonData.aliSmsAccessKeySecret'
			placeholder="{{ctrl.current.secureJsonFields.aliSmsAccessKeySecret ? 'configured' : ''}}" ></input>
	</div>
	<div class="gf-form-inline">
		<div class="gf-form max-width-15">
			<span class="gf-form-label width-7">signName</span>
			<input type="text" class="gf-form-input" name="signName"
			  ng-model='ctrl.current.secureJsonData.aliSmsSignName'
				placeholder="{{ctrl.current.secureJsonFields.aliSmsSignName ? 'configured' : ''}}"
				></input>
		</div>
		<div class="gf-form max-width-15">
			<span class="gf-form-label width-7">templateCode</span>
			<input type="text" class="gf-form-input" name="templateCode"
				ng-model='ctrl.current.jsonData.secureJsonData.aliSmsTemplateCode'
				placeholder="{{ctrl.current.secureJsonFields.aliSmsTemplateCode ? 'configured' : ''}}" ></input>
		</div>
	</div>
	<div class="gf-form max-width-30">
		<span class="gf-form-label width-7">templateParam</span>
		<input type="text" class="gf-form-input" name="templateParam"
			ng-model='ctrl.current.jsonData.secureJsonData.aliSmsTemplateParam'
			placeholder="{{ctrl.current.secureJsonFields.aliSmsTemplateParam ? 'configured' : ''}}" ></input>
	</div>
	<div class="gf-form max-width-30">
		<span class="gf-form-label width-7">phoneNumbers</span>
		<input type="text" class="gf-form-input" name="phoneNumbersList"
		  ng-model='ctrl.current.secureJsonData.aliSmsPhoneNumbersList'
			placeholder="{{ctrl.current.secureJsonFields.aliSmsPhoneNumbersList ? 'configured' : '131xxxxxxxx,132xxxxxxxx'}}" ></input>
	</div>
	<div class="gf-form max-width-30">
		<span class="gf-form-label width-7">listenAddr</span>
		<input type="text" class="gf-form-input" name="listenAddr"
		  ng-model='ctrl.current.secureJsonData.aliSmsListenAddr'
			placeholder="{{ctrl.current.secureJsonFields.aliSmsListenAddr ? 'configured' : '127.0.0.1:10610'}}" ></input>
	</div>
	<div class="gf-form max-width-30">
		<pre
			class="gf-form-pre">If you enable this feature, you can input http://listenAddr/sms (for example: http://127.0.0.1:10610/sms) into alerting->notification channels->webhook->url </pre>
	</div>
</div>
